abstract class Animal {
  eat(); //抽象方法
  run();
  printInfo() {
    print('我说一个抽象类里的普通方法');
  }
}

class Dog extends Animal {
  @override
  eat() {
    // TODO: implement eat
    print("小狗在吃骨头");
  }

  @override
  run() {
    // TODO: implement run
    print("小狗在跑");
  }
}

class Cat extends Animal {
  @override
  eat() {
    // TODO: implement eat
    print("小猫在吃骨头");
  }

  @override
  run() {
    // TODO: implement run
    print("小猫在跑");
  }
}

main() {
  Dog d = new Dog();
  d
    ..eat()
    ..run()
    ..printInfo();
  Cat c = new Cat();
  c
    ..eat()
    ..run()
    ..printInfo();
}
